package com.broada.apm.thrift.model;

import java.net.Socket;

import org.apache.thrift.transport.TSocket;
import org.apache.thrift.transport.TTransportException;

/**
 * TTransport扩展
 * @author jianfei.xu
 * @date   2016年3月25日
 *
 */
public class TSocketExt extends TSocket {
	private boolean isNewCreate = true;
	
	private long borrowTime; //借出时间点
	
	private boolean isSocketTimeOut = false; //是否socket超时
	
	public TSocketExt(Socket socket) throws TTransportException {
		super(socket);
	}

	public TSocketExt(String host, int port) {
		super(host, port, 0);
	}

	public TSocketExt(String host, int port, int timeout) {
		super(host, port, timeout, timeout);
	}

	public TSocketExt(String host, int port, int socketTimeout, int connectTimeout) {
		super(host, port, socketTimeout, connectTimeout);
	}

	public boolean isNewCreate() {
		return isNewCreate;
	}

	public void setNewCreate(boolean isNewCreate) {
		this.isNewCreate = isNewCreate;
	}
	
	public long getBorrowTime() {
		return borrowTime;
	}

	public void setBorrowTime(long borrowTime) {
		this.borrowTime = borrowTime;
	}

	public boolean isSocketTimeOut() {
		return isSocketTimeOut;
	}

	public void setSocketTimeOut(boolean isSocketTimeOut) {
		this.isSocketTimeOut = isSocketTimeOut;
	}
	
}
